﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CROSLAND.BL.BE;
using System.Data.Common;
using System.Data;

namespace CROSLAND.DL.DALC.MSSQL
{
    public class OficinaDALC : BaseDALC, IOficinaDALC
    {        
        #region IOficinaDALC Members

        public List<GenericBE> listar()
        {
            List<GenericBE> entitys = new List<GenericBE>();            

            DbCommand command = dbProvider.GetStoredProcCommand("ZWEB_LISTA_OFICINAS");

            using (IDataReader dr = dbProvider.ExecuteReader(command))
            {
                while (dr.Read())
                {
                    GenericBE entity = new GenericBE();

                    entity.Codigo = dr["VKBUR"].ToString();
                    entity.Descripcion = dr["VKBUR"].ToString() + " :: " + dr["BEZEI"].ToString();
                                        
                    entitys.Add(entity);
                }
            }

            return entitys;        
        }

        public List<GenericBE> buscar(string pNombre)
        {
            throw new NotImplementedException();
        }

        public GenericBE leer(string pCodigo)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
